<?php

class AjaxAction extends Action {
	//生成验证码
	public function verify() {
		
// 		$code = rand(1000,9999);
// 		session('verify',$code);
		import('ORG.Util.Image');
		Image::buildImageVerify(4,1,'png','',30);//采用纯数字
    }
    
    //发送验证码
    public function sendmobileverify() {
    	$verify = rand(1000,9999);
    	session('mobileverify',$verify);
    	CommonFunc::SendComSMS('29139','15659104630',$verify);
    	Log::write('15659104630短信验证码：'.$verify, Log::SQL);
    	$this->ajaxReturn('发送成功','success',1);
    }
    
    //官方代理商添加核心代理商时发送验证码
    public function sendmobileverify2() {
    	$uid = $_GET['uid'];
    	if($uid!='') {
    		$ob = M ( "csl_user" );
    		$map['uid'] = $uid;
    		$result = $ob->where($map)->find();
    		$mobile = $result['mobile']; 
    		
	    	$verify = rand(1000,9999);
	    	session('mobileverify',$verify);
	    	CommonFunc::SendComSMS('29139',$mobile,$verify);
	    	Log::write($mobile.'短信验证码：'.$verify, Log::SQL);
	    	$this->ajaxReturn('发送成功','success',1);
    	}else{
    		$this->ajaxReturn('发送失败','failer',0);
    	}
    }
    
    public function xianshi() {
    //	dayin($_SESSION);
    }

}














